package main

import (
	"gin-shop-admin/common"
	"gin-shop-admin/dao"
	"gin-shop-admin/models"
	"gin-shop-admin/routers"
)

func main() {
	err := dao.InitDB()
	if err != nil {
		panic(err)
	}
	defer dao.Close()
	models.Model_migrate()
	r := routers.SetupRouters()

	//初始化配置文件
	err = common.GetConfigIni("config/config.ini")
	if err != nil {
		panic(err)
	}

	_ = r.Run(":8000")
}
